package com.zhongwang.mms.module.material.dao;

import com.zhongwang.mms.gen.entity.MAdjustmentApply;
import com.zhongwang.mms.gen.entity.MAdjustmentApplyExample;
import com.zhongwang.mms.module.material.model.MAdjustmentApplyModel;
import com.zhongwang.mms.module.material.model.MCheckDetailModel;
import com.zhongwang.mms.module.material.model.MCheckResultCommitSumModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MAdjustmentApplyDao {
    long countByExample(MAdjustmentApplyExample example);

    int deleteByExample(MAdjustmentApplyExample example);

    int deleteByPrimaryKey(Integer ajaId);

    int insert(MAdjustmentApply record);

    int insertSelective(MAdjustmentApply record);

    List<MAdjustmentApply> selectByExample(MAdjustmentApplyExample example);

    MAdjustmentApply selectByPrimaryKey(Integer ajaId);

    int updateByExampleSelective(@Param("record") MAdjustmentApply record, @Param("example") MAdjustmentApplyExample example);

    int updateByExample(@Param("record") MAdjustmentApply record, @Param("example") MAdjustmentApplyExample example);

    int updateByPrimaryKeySelective(MAdjustmentApply record);

    int updateByPrimaryKey(MAdjustmentApply record);

    /*--myself--*/

    /**
     * 盘点明细查询
     *
     * @param checkDetailModel 查询条件
     * @return
     */
    List<MCheckDetailModel> findAdjustListByQuery(MCheckDetailModel checkDetailModel);

    /**
     * 损溢明细调整（盘盈）
     *
     * @param adjustmentApplyModel 查询条件
     * @return
     */
    List<MAdjustmentApplyModel> findAdjustStockLossListByQuery(MAdjustmentApplyModel adjustmentApplyModel);

    /**
     * 损溢明细调整（盘盈）
     *
     * @param adjustmentApplyModel 查询条件
     * @return
     */
    List<MAdjustmentApplyModel> findAdjustStockProfitListByQuery(MAdjustmentApplyModel adjustmentApplyModel);

    /**
     * 盘点损益表
     *
     * @param adjustmentApplyModel 查询条件
     * @return
     */
    List<MAdjustmentApplyModel> findResultCommitListByQuery(MAdjustmentApplyModel adjustmentApplyModel);

    /**
     * 选中行损益汇总
     *
     * @param checkResultCommitSumModel 查询条件
     * @return
     */
    List<MCheckResultCommitSumModel> findResultCommitSumByQuery(MCheckResultCommitSumModel checkResultCommitSumModel);

}